package com.example.aop.main;

import com.example.aop.tester.MyArgs;

import java.io.Serializable;
import java.lang.reflect.Proxy;

public class ProxyTester {

    public static void main(String[] args) {
        MyProxyTarget myProxyTarget = (MyProxyTarget) Proxy.newProxyInstance(MyProxyTarget.class.getClassLoader(), new Class[]{Serializable.class}, (proxy, method, args1) -> method.invoke(proxy, args1));
        MyArgs myArgs = new MyArgs();
        myArgs.setName("1");
        myProxyTarget.myMethod(myArgs);
    }

}
